package com.boyu.common.interceptor;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

/**
 * Created by Administrator on 2017/4/27.
 */
public class ContextInterceptor implements Interceptor {
	@Override
	public void intercept(Invocation inv) {
		System.out.println("Before method invoking");
		inv.invoke();
		String contextPath = inv.getController().getRequest().getContextPath();
		inv.getController().setAttr("ctx",contextPath);
		System.out.println("After method invoking");
	}
}
